/* src/components/timeline/AddCameraClip.css */

/* 定义CSS变量，便于维护 */
:root {
    --track-bg-color: #151515;
    --track-border-color: #333;
    --video-clip-primary: rgba(46, 204, 113, 0.7);
    --video-clip-secondary: rgba(54, 46, 204, 0.4);
    --accent-color: #2ecc71;
    --accent-hover: #27ae60;
    --text-color: #fff;
    --glow-color: rgba(46, 204, 113, 0.5);
}

.add-camera-clip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    /* 使用与视频片段协调的绿色主题渐变 */
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.2), rgba(54, 46, 204, 0.1));
    /* 精致的边框和内阴影 */
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    color: var(--text-color);
    overflow: hidden;
    white-space: nowrap;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    margin-left: 3px; /* 与最后一个视频片段保持一点距离 */
    /* 添加精致的内发光效果 */
    box-shadow:
        inset 0 0 8px rgba(46, 204, 113, 0.1),
        0 0 0 1px rgba(46, 204, 113, 0.05);
    /* 添加微妙的纹理图案 */
    background-image: radial-gradient(circle at 25% 25%, rgba(46, 204, 113, 0.1) 1px, transparent 1px), radial-gradient(circle at 75% 75%, rgba(46, 204, 113, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* 添加伪元素以创建更丰富的视觉层次 */
.add-camera-clip::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 49%, rgba(46, 204, 113, 0.1) 50%, transparent 51%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.add-camera-clip:hover {
    /* 悬停时的主要变化 */
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3), rgba(54, 46, 204, 0.2));
    border-color: rgba(46, 204, 113, 0.6);
    transform: translateY(-50%) translateY(1px) scale(1.03);
    box-shadow:
        inset 0 0 12px rgba(46, 204, 113, 0.2),
        0 4px 16px rgba(46, 204, 113, 0.25),
        0 0 0 1px rgba(46, 204, 113, 0.1);
}

.add-camera-clip:hover::before {
    opacity: 1;
    animation: scanline 2s linear infinite;
}

.add-camera-clip:active {
    transform: translateY(-50%) scale(0.98);
    box-shadow:
        inset 0 0 12px rgba(46, 204, 113, 0.3),
        0 1px 6px rgba(46, 204, 113, 0.2);
}

/* 扫描线动画 */
@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

.add-camera-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    text-align: center;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.add-camera-clip:hover .add-camera-content {
    transform: translateY(-2px);
}

.add-camera-content svg {
    margin-bottom: 6px;
    opacity: 0.9;
    transition: all 0.3s ease;
    /* 为图标添加微妙的发光效果 */
    filter: drop-shadow(0 0 4px rgba(46, 204, 113, 0.5));
}

.add-camera-clip:hover .add-camera-content svg {
    opacity: 1;
    transform: scale(1.1);
    filter: drop-shadow(0 0 6px rgba(46, 204, 113, 0.7));
}

.add-camera-content span {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(46, 204, 113, 0.2);
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

.add-camera-clip:hover .add-camera-content span {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4));
    border-color: rgba(46, 204, 113, 0.4);
    transform: translateY(2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .add-camera-clip {
        width: 80px;
        margin-left: 5px;
    }

    .add-camera-content {
        padding: 8px 10px;
    }

    .add-camera-content span {
        font-size: 0.7em;
        padding: 3px 6px;
    }

    .add-camera-content svg {
        width: 18px;
        height: 18px;
        margin-bottom: 4px;
    }
}

/* 高分辨率屏幕适配 */
@media (min-resolution: 192dpi) {
    .add-camera-clip {
        background-image: radial-gradient(circle at 25% 25%, rgba(46, 204, 113, 0.1) 0.5px, transparent 0.5px), radial-gradient(circle at 75% 75%, rgba(46, 204, 113, 0.1) 0.5px, transparent 0.5px);
        background-size: 10px 10px;
    }
}
